package com.agy.filemanager.service.impl;

import com.agy.filemanager.entity.DcBaseMenu;
import com.agy.filemanager.entity.DcManagerInfo;
import com.agy.filemanager.entity.DcViewSystemUsers;
import com.agy.filemanager.mapper.DcLoginInfoDao;
import com.agy.filemanager.service.DcLoginInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 登陆模块-
 * @author jpf
 */
@Service
public class DcLoginInfoServiceImpl implements DcLoginInfoService {
    @Autowired
    private DcLoginInfoDao dcLoginInfoDao;

    /**
     * -根据用户名获取用户信息
     * @param account 用户名
     * @return DcManagerInfo
     */
    @Override
    public DcViewSystemUsers selectByAccount(String account,String sign) {
        DcViewSystemUsers userinfo = this.dcLoginInfoDao.selectByAccount(account,sign);
        return userinfo;
    }

    /**
     * -注册用户
     * @param entity DcManagerInfo
     */
    @Override
    public void insertUser(DcManagerInfo entity) {
        this.dcLoginInfoDao.insertUser(entity);
    }

    /**
     * 系统管理员默认所有一级菜单可见
     * @return
     */
    @Override
    public List<DcBaseMenu> selectMenusByUser() {
        List<DcBaseMenu> menuList = this.dcLoginInfoDao.selectMenusByUser();
        return menuList;
    }
}
